<template>
    <div>
        <el-menu
                :default-active="anActionIndex"
                class="el-menu-vertical-demo"
                background-color="#204051"
                text-color="#fff"
                active-text-color="#ffd04b"
                router
        >
            <el-menu-item index="/back/staffNav">
                <i class="el-icon-s-custom"></i>
                <span slot="title">员工管理</span>
            </el-menu-item>
            <el-menu-item index="/back/cuisineNav">
                <i class="el-icon-menu"></i>
                <span slot="title">菜品管理</span>
            </el-menu-item>
            <el-menu-item index="/back/consumablNav">
                <i class="el-icon-s-claim"></i>
                <span slot="title">消耗品管理</span>
            </el-menu-item>
            <el-menu-item index="/back/operationNav">
                <i class="el-icon-s-shop"></i>
                <span slot="title">运营管理</span>
            </el-menu-item>
        </el-menu>
    </div>
</template>

<script>
    export default {
        name: "adminNav",
        computed:{
            anActionIndex:{
                get:function () {
                    let arr = this.$route.path.split('/');
                    switch (arr[2]) {
                        case 'staffInformation':
                            return '/back/staffNav'
                        case 'staffPositions':
                            return '/back/staffNav'
                        case 'staffPermissions':
                            return '/back/staffNav'
                        case 'foodsSet':
                            return '/back/cuisineNav'
                        case 'foodsType':
                            return '/back/cuisineNav'
                        case 'consumablesManagement':
                            return '/back/consumablNav'
                        case 'consumablesType':
                            return '/back/consumablNav'
                        case 'employeeScheduling':
                            return '/back/operationNav'
                        case 'restaurantBusiness':
                            return '/back/operationNav'
                        case 'restaurantTable':
                            return '/back/operationNav'
                        case 'restaurantMember':
                            return '/back/operationNav'
                        case 'financialManagement':
                            return '/back/moneyNav'
                        case 'costManagement':
                            return '/back/moneyNav'
                        case 'wageManagement':
                            return '/back/moneyNav'
                        case 'dataManipulation':
                            return '/back/systemNav'
                        case 'staffOperationLog':
                            return '/back/systemNav'
                    }
                },
                set:function () {

                }
            }

        }
    }
</script>

<style scoped>

</style>